package com.example.chapter09;

public class test8 {
    public static void main(String[] args) {
        String str = "Hello, world!";
        int index = str.indexOf("world");
        System.out.println(index);

        boolean startsWithHello = str.startsWith("Hello");
        boolean endsWithWorld = str.endsWith("world!");
        System.out.println(startsWithHello);

        String str2 = "12345";
        boolean isNumeric = str2.matches("\\d+");
        System.out.println(isNumeric);

        boolean containsWorld = str.contains("world");
        System.out.println(containsWorld);
    }

}
